import { createApp } from 'vue'
import { markRaw } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import router from './router/index.js'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persist'
import './assets/css/mainDefault.css'

import http from '@/utils/http'


const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)


// pinia
app.use(pinia)
// router
app.use(router)
app.config.globalProperties.$http = http
// ElementPlus UI组件
app.use(ElementPlus, { size: 'large' })
// 引入所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, markRaw(component))
}

app.mount('#app')
